package com.dup.jxlh.api.enums;

public enum ChapterApplyStatusEnum {
    CHECKING(1, "待审核"),
    AGREE(2, "通过"),
    REFUSE(3, "拒绝"),
    CANCEL(4, "作废");

    private Integer code;
    private String name;

    ChapterApplyStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(Integer code) {
        for (ChapterApplyStatusEnum stateEnum: values()){
            if(stateEnum.getCode() == code){
                return stateEnum.getName();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
